<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
  <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  <link rel="stylesheet" href="../../css/animate.css">
  <link rel="stylesheet" href="../../iconfont/iconfont.css">
  <link rel="stylesheet" href="../../css/mescroll.css">
  <link rel="stylesheet" href="../../css/gloab.css">
  <title>设置</title>
  <style media="screen">
  .checke{
     position: relative;
     -webkit-appearance: none;
     width:90px;
     height: 44px;
     line-height: 44px;
     background: #eee;
     border-radius: 30px;
     outline: none;
 }
 .checke:before{
     position: absolute;
     left: 0;
     content: '';
     width: 44px;
     height: 44px;
     border-radius: 50%;
     background: #eee;
     box-shadow: 0px 0px 5px #ddd;
     transition: all 0.2s linear;
 }

 .checke:checked{
    background: #18ff0a;
 }
 .checke:checked:before{
     left: 45px;
     transition: all 0.2s linear;
 }
 [v-cloak]{display: none;}
  </style>
</head>
<body>
  <div id="app" v-cloak>
    <div id="public-header">
      <div id="statusbar"></div>
      <header class="public-header">
        <div class="public-header-lf iconfont icon-fanhui" @click="javascript:api.closeWin();"></div>
        <div class="public-header-title">设置</div>
        <!-- <div class="public-header-text" @click="javascript:api.openWin({name: 'fahongbao',reload:true,url:'../home/fabu.html',});">我要发红包</div> -->
      </header>
    </div>
    <div class="personal-navbar" style="">
      <div class="personal-navbar-sons flex"  @click="javascript:api.openWin({name: 'update_name',reload:true,url:'./update_name.html'});">
        <div class="personal-navbar-son-fl F1">
          <img src="../../image/public/nc.png" alt="">
          <span>设置昵称/微信</span>
        </div>
        <div class="personal-navbar-son-rt F1">
            <span class="iconfont icon-qianwang"></span>
        </div>
      </div>
      <!-- <div class="personal-navbar-son flex" @click="javascript:api.openWin({name: 'updatephone',reload:true,url:'./updatephone.html',pageParam: {avatar:api.pageParam.avatar}});">
        <div class="personal-navbar-son-fl F1">
          <img src="../../image/public/phone.png" alt="">
          <span>绑定手机号/微信号</span>
        </div>
        <div class="personal-navbar-son-rt F1">
            <span class="iconfont icon-qianwang"></span>
        </div>
      </div> -->
      <div class="personal-navbar-sons flex"  @click="javascript:api.openWin({name: 'update_img',reload:true,url:'./update_img.html',pageParam: {avatar:api.pageParam.avatar}});">
        <div class="personal-navbar-son-fl F1">
          <img src="../../image/public/tx.png" alt="">
          <span>修改头像</span>
        </div>
        <div class="personal-navbar-son-rt F1">
            <span class="iconfont icon-qianwang"></span>
        </div>
      </div>
      <div class="personal-navbar-sons flex"  @click="javascript:api.openWin({name: 'pwd',reload:true,url:'./pwd.html',pageParam: {phone:api.pageParam.phone}});">
        <div class="personal-navbar-son-fl F1">
          <img src="../../image/public/mm.png" alt="">
          <span>修改密码</span>
        </div>
        <div class="personal-navbar-son-rt F1">
            <span class="iconfont icon-qianwang"></span>
        </div>
      </div>
      <div class="personal-navbar-sons flex"  @click="clear">
        <div class="personal-navbar-son-fl F1">
          <img src="../../image/public/hc.png" alt="">
          <span>清除缓存</span>
        </div>
        <div class="personal-navbar-son-rt F1 flex wrap">
          <div class="F1">
            <span style="color:#000;">{{size}}M
              <!-- <font style="margin-left:0.02rem;color:#3b8bff;">清除</font> -->
            </span>
          </div>
          <div style="margin-top:0.02rem;">
            <span class="iconfont icon-qianwang"></span>
          </div>
        </div>
        <!-- <div class="personal-navbar-son-rt F1">
            <span class="iconfont icon-qianwang"></span>
        </div> -->
      </div>
<!-- 
      <div class="personal-navbar-sons flex" v-if="auto_refersh_adv_status != 2">
          <div class="personal-navbar-son-fl F1" @click="refresh_adv()">
              <img src="../../image/public/mm.png" alt="">
              <span v-if="auto_refersh_adv_status == 1"><b style="color: red">开启</b>广告自动刷新</span>
              <span v-else><b style="color: red">关闭</b>广告自动刷新</span>
          </div>
          <div class="personal-navbar-son-rt F1 flex wrap">
              <div class="F1">
              </div>
              <div style="margin-top:0.02rem;">
                  <span class="iconfont icon-qianwang"></span>
              </div>
          </div>
      </div> -->

  </div>
  <div class="public-progress" style="z-index:9;">
    <img src="../../icon/icon150x150.png" alt="" class="animated infinite flash" style="width:200px;height:200px;display:block;margin:200px auto;">
  </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/jquery.js"></script>
<script src="../../script/mescroll.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/jsencrypt.js"></script>
<script src="../../script/fastclick.js"></script>

<script>
var vm;
var mescroll;
apiready=function(){
  api.removeLaunchView();
  setBar("statusbar");
  setFont(750);
  startVue();
  $(".public-progress").fadeOut(1000);
  setTimeout(function(){
    $(".public-progress").css({"display":"none"});
  },2000);
}
function startVue(){
  vm = new Vue({
    el:"#app",
    data:{
      gdtt:['50','100','200','300','500','1000'],
      num:0,
      list:[],
      integral:'',
      kefu:[],
      is_SignIn:true,
      size: '',
      auto_refersh_adv_status: 2,
      is_click: false,
    },
    created:function(){
        this.get_auto_refersh_adv_status();
        this.getSize();
    },
    methods:{
      getSize:function(){
        var self = this;
        //异步返回结果：
        api.getCacheSize(function(ret) {
            var size = ret.size/1024/1024;
            self.size = size.toFixed(2);
        });
      },
      get_auto_refersh_adv_status: function(){
          api.ajax({
              url: apiUrl + 'api/users/get_refresh_status',
              method: 'post',
              data: {
                  values: {
                      users_id: post_en($api.getStorage('uid')),
                  },
              }
          },function(ret, err){
              if(ret.status){
                  vm.auto_refersh_adv_status = ret.data;
              }
          });
      },
      refresh_adv: function(){
          if(vm.is_click){ return false; }
          vm.is_click = true;
          api.ajax({
              url: apiUrl + 'api/users/set_auto_refresh_adv_status',
              method: 'post',
              data: {
                  values: {
                      users_id: post_en($api.getStorage('uid')),
                      status: vm.auto_refersh_adv_status
                  },
              }
          },function(ret, err){
              if(ret.status){
                  var msg = vm.auto_refersh_adv_status ? '开启广告自动刷新成功' : '关闭广告自动刷新成功';
                  api.toast({
                      location: 'middle',
                      msg: msg
                  });

                  vm.auto_refersh_adv_status = 1 ^ vm.auto_refersh_adv_status;
              }
              vm.is_click = false;
          });
      },
      clear:function(){
        api.clearCache(function() {
            api.toast({
                msg: '清除完成'
            });
            location.reload();
        });
      },
    }
  })
}

</script>
</html>
